import store from "@/store";

export const formItemStyle = {
  paddingLeft: "20px",
};

// 单元格样式
export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};

export const formBase = [
  {
    label: "日期",
    type: "daterange",
    field: "startTime",
    otherOptions: {
      disabled: false,
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      valueFormat: 'yyyy-MM-dd hh:mm:ss',
      pickerOptions: {
        shortcuts: [
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "三天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "一月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    },
  },
  {
    label: "会员ID",
    type: "input",
    field: "userId",
    otherOptions: {},
  },
  {
    label: "昵称",
    type: "input",
    field: "userName",
  },
  {
    label: "仓库",
    type: "select",
    field: "warehouseId",
    optionsKey: "warehouseName",
    optionsValue: "id",
    options: store.state.custom_dict.warehouse,
  },
];

export const tableBase = [
  {
    label: "仓库",
    prop: "warehouseName",
    width: 150,
    operate: {
      type: "select",
      field: "warehouseId",
      optionsKey: "warehouseName",
      optionsValue: "id",
      options: store.state.custom_dict.warehouse,
    },
  },
  {
    label: "ID",
    prop: "id",
    width: 50
  },
  {
    label: "到达时间",
    prop: "arrivalTime",
    width: "150",
    operate: {
      type: "datePicker",
      field: "arrivalTime",
      disabled: false,
    },
  },
  {
    label: "垫付费",
    prop: "advancePayment"
  },
  {
    label: "货物名称",
    prop: "cargoName",
    otherOptions: {},
    width: 100,
    operate: {
      type: "input",
      field: "cargoName",
      rules: /^[a-zA-Z0-9]{4,16}$/,
    },
  },
  {
    label: "快递号",
    prop: "courierNumber",
    otherOptions: {},
    operate: {
      type: "input",
      field: "courierNumber",
    },
  },
  {
    label: "仓租费",
    prop: "warehouseFee"
  },
  {
    label: "转运单号",
    prop: "transitOrderNo"
  },
  {
    label: "入库员",
    prop: "inventoryScanner"
  },
  {
    label: "承运公司",
    prop: "carrierCompany"
  },
  {
    label: "快递公司",
    prop: "companyName",
    width: 150,
    operate: {
      type: "select",
      field: "companyId",
      optionsKey: "companyName",
      optionsValue: "id",
      options: store.state.custom_dict.company,
    },
  },
  {
    label: "会员号",
    prop: "userId",
    otherOptions: {},
    operate: {
      type: "input",
      field: "userId",
    },
  },
  {
    label: "会员昵称",
    prop: "userName",
    otherOptions: {},
    operate: {
      type: "input",
      field: "userName",
    },
  },
  {
    label: "收货人",
    prop: "recipient",
    otherOptions: {},
    operate: {
      type: "input",
      field: "recipient",
    },
  },
  {
    label: "收货人手机",
    prop: "mobilePhone",
    otherOptions: {},
    operate: {
      type: "input",
      field: "mobilePhone",
    },
  },
  {
    label: "所属店铺",
    prop: "shopName",
    width: 150,
    operate: {
      type: "select",
      field: "shopName",
      optionsKey: "shopName",
      optionsValue: "id",
      options: store.state.custom_dict.shop,
    },
  },
  {
    label: "客户登记时间",
    prop: "registerTime",
    width: "150",
    operate: {
      type: "datePicker",
      field: "registerTime",
      disabled: false,
    },
  },
  {
    label: "实重",
    prop: "weight",
    otherOptions: {},
    width: 150,
    operate: {
      type: "inputNumber",
      field: "weight",
    },
  },
  {
    label: "实重2",
    prop: "weight2",
    otherOptions: {},
    width: 150,
    operate: {
      type: "inputNumber",
      field: "weight2",
    },
  },
  {
    label: "体积重",
    prop: "volumeWeight",
    otherOptions: {},
    width: 150,
    operate: {
      type: "inputNumber",
      field: "volumeWeight",
    },
  },
  {
    label: "计重费",
    prop: "chargeWeight",
    otherOptions: {},
    width: 150,
    operate: {
      type: "inputNumber",
      field: "chargeWeight",
    },
  },
  {
    label: "尺寸",
    prop: "cargoDimensions",
    width: 150,
    operate: {
      type: "inputNumber",
      field: "cargoDimensions",
    },
  },
  {
    label: "存放库区",
    prop: "storageLocationName",
    operate: {
      type: "input",
      field: "storageLocationName",
    },
  },
  {
    label: "分配库区",
    prop: "assignedLocationName",
    otherOptions: {},
    operate: {
      type: "input",
      field: "assignedLocationName",
    },
  },
  {
    label: "货物数量",
    prop: "cargoQuantity",
    width: "100",
    otherOptions: {},
    operate: {
      type: "inputNumber",
      field: "cargoQuantity",
    },
  },
  {
    label: "件数",
    prop: "pieces",
    width: "100",
    otherOptions: {},
    operate: {
      type: "inputNumber",
      field: "pieces",
    },
  },
  {
    label: "单件价值",
    prop: "singleValue",
    width: "100",
    otherOptions: {},
    operate: {
      type: "inputNumber",
      field: "singleValue",
    },
  },
  {
    label: "是否上架",
    prop: "isUp",
    otherOptions: {},
    slotName: "isUp",
  },
  {
    label: "上架时间",
    prop: "shelfTime",
    width: 150,
    operate: {
      type: "datePicker",
      field: "shelfTime",
    },
  },
  {
    label: "上架员工",
    prop: "shelfEmployee",
    width: 150,
    operate: {
      type: "input",
      field: "shelfEmployee",
    },
  },
  {
    label: "是否确认",
    prop: "confirmed",
    otherOptions: {},
    slotName: "confirmed",
  },
  {
    label: "确认时间",
    prop: "confirmedTime",
    otherOptions: {},
    slotName: "confirmedTime",
  },
  {
    label: "订单号",
    prop: "orderNo",
    width: 250,
    operate: {
      type: "input",
      field: "orderNo",
    },
  },
  {
    label: "是否下架",
    prop: "isDown",
    otherOptions: {},
    slotName: "isDown",
  },
  {
    label: "下架时间",
    prop: "removeTime",
    width: 150,
    operate: {
      type: "datePicker",
      field: "removeTime",
    },
  },
  {
    label: "备注",
    prop: "remarks",
    otherOptions: {},
    operate: {
      type: "input",
      field: "remarks",
    },
  },
  {
    label: "货物备注",
    prop: "cargoRemarks",
    otherOptions: {},
    operate: {
      type: "input",
      field: "cargoRemarks",
    },
  },
  {
    label: "弃件",
    prop: "isJettisons",
    slotName: "isJettisons",
    otherOptions: {},
    operate: {
      type: "input",
      field: "isJettisons",
    },
  },
  {
    label: "货物类型",
    prop: "cargoType",
    width: 150
  },
  {
    label: "是否预报",
    prop: "isPreorder",
    slotName: "isPreorder",
    otherOptions: {},
    operate: {
      type: "switch",
      field: "isPreorder",
      otherOptions: {
        activeValue: 1,
        inactiveValue: 0,
      },
    },
  },
  {
    label: "超长费",
    prop: "extraFee",
    width: 150,
    operate: {
      type: "inputNumber",
      field: "extraFee",
    },
  },
  {
    label: "货物状态",
    prop: "cargoStatus",
    width: 150,
    operate: {
      type: "input",
      field: "cargoStatus",
    },
  },
  {
    label: "三遍总长",
    prop: "totalLength",
    width: 100,
    operate: {
      type: "inputNumber",
      field: "totalLength",
    },
  },
  {
    label: "立方数",
    prop: "cubicCount",
    width: 100,
    operate: {
      type: "inputNumber",
      field: "cubicCount",
    },
  },
  {
    label: "单价",
    prop: "unitPrice",
    width: 100,
    operate: {
      type: "inputNumber",
      field: "unitPrice",
    },
  },
  {
    label: "费用",
    prop: "dueFee",
    width: 100,
    operate: {
      type: "inputNumber",
      field: "dueFee",
    },
  },
  {
    label: "噱头",
    prop: "marking",
    width: 100,
    operate: {
      type: "input",
      field: "marking",
    },
  },
  {
    label: "客服",
    prop: "customerService",
    width: 100
  },
  {
    label: "车辆编号",
    prop: "vehicleNo",
    width: 100,
    operate: {
      type: "input",
      field: "vehicleNo",
    },
  },
  {
    label: "长",
    prop: "longs",
    width: 100,
    operate: {
      type: "input",
      field: "longs",
    },
  },
  {
    label: "宽",
    prop: "widths",
    width: 100,
    operate: {
      type: "input",
      field: "widths",
    },
  },
  {
    label: "高",
    prop: "heights",
    width: 100,
    operate: {
      type: "input",
      field: "heights",
    },
  },
];
